package cn.maihe.elg.operation.centers.guogu.channel;

import cn.maihe.elg.operation.centers.guogu.channel.service.GuoGuCusQueryChannelService;
import cn.maihe.elg.operation.centers.guogu.channel.service.GuoGuInvoiceNotifyChannelService;
import cn.maihe.elg.operation.centers.guogu.channel.service.GuoGuPaymentNotifyChannelService;
import cn.maihe.elg.operation.centers.guogu.channel.service.GuoGuReductionNotifyChannelService;
import cn.maihe.elg.operation.centers.guogu.dto.GuoGuBaseRespDTO;
import cn.maihe.elg.operation.centers.guogu.dto.channel.req.GuoGuReductionNotifyReq;
import cn.maihe.elg.operation.centers.guogu.dto.channel.resp.GuoGuCusQueryRespData;
import cn.maihe.elg.operation.centers.supports.model.bo.NoticeGuaranteeApplyResultBo;
import cn.maihe.elg.operation.centers.supports.model.bo.NoticePayResultBo;
import cn.maihe.elg.operation.model.dto.InnerBaseResp;
import cn.maihe.elg.operation.model.enums.CenterNoEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
@Slf4j
public class GuoGuCenterInterfaceServiceImpl extends GuoGuBaseCenterInterfaceService {
    @Resource
    private GuoGuPaymentNotifyChannelService guoGuPaymentNotifyChannelService;

    @Resource
    private GuoGuCusQueryChannelService guoGuCusQueryChannelService;

    @Resource
    private GuoGuInvoiceNotifyChannelService guoGuInvoiceNotifyChannelService;

    @Resource
    private GuoGuReductionNotifyChannelService guoGuReductionNotifyChannelService;

    @Override
    public CenterNoEnum getCenterNoEnum() {
        return CenterNoEnum.GUOGU;
    }

    /**
     * 支付结果通知
     * @return
     */
    @Override
    public InnerBaseResp<NoticeGuaranteeApplyResultBo> noticePayResult(NoticePayResultBo bo) {
        return guoGuPaymentNotifyChannelService.paymentNotify(bo.getClientId(), bo);
    }

    /**
     * 客户资料查询
     */
    @Override
    public InnerBaseResp<GuoGuCusQueryRespData> queryCusInfo(String clientId, CenterNoEnum centerNoEnum, String applyno) {
        return guoGuCusQueryChannelService.queryCusInfo(clientId,centerNoEnum,applyno );
    }

    /**
     * 电子发票结果通知 InvoiceNotice
     */
    @Override
    public InnerBaseResp<GuoGuBaseRespDTO> invoiceResultNotify(String acceptOrderNo) {
        return guoGuInvoiceNotifyChannelService.invoiceResultNotify(acceptOrderNo);
    }

    /**
     * 还原结果推送
     */
    @Override
    public InnerBaseResp<GuoGuBaseRespDTO> reductionResultNotify(String clientId, GuoGuReductionNotifyReq guoGuReductionNotifyReq,CenterNoEnum centerNoEnum) {
        return guoGuReductionNotifyChannelService.reductionResultNotify(clientId, guoGuReductionNotifyReq,centerNoEnum);
    }
}
